:root {
  --expo-out: linear(
    0 0%,
    0.1684 2.66%,
    0.3165 5.49%,
    0.446 8.52%,
    0.5581 11.78%,
    0.6535 15.29%,
    0.7341 19.11%,
    0.8011 23.3%,
    0.8557 27.93%,
    0.8962 32.68%,
    0.9283 38.01%,
    0.9529 44.08%,
    0.9711 51.14%,
    0.9833 59.06%,
    0.9915 68.74%,
    1 100%
  );
}

::view-transition-group(root) {
  animation-timing-function: var(--expo-out);
  animation-duration: 0.8s;
}

::view-transition-new(root) {
  mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><filter id="blur"><feGaussianBlur stdDeviation="2"/></filter></defs><circle cx="0" cy="0" r="18" fill="white" filter="url(%23blur)"/></svg>')
    top left / 0 no-repeat;
  mask-origin: content-box;
  animation: scale 0.8s ease-out forwards;
  transform-origin: top left;
  z-index: 1;
}

::view-transition-old(root),
.dark::view-transition-old(root) {
  animation: fadeOut 0.8s ease-out forwards;
  transform-origin: top left;
  z-index: 0;
}

@keyframes scale {
  0% {
    mask-size: 0;
  }
  100% {
    mask-size: 350vmax;
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
